<template>
	<el-pagination
		@size-change="handleSizeChange"
		@current-change="handleCurrentChange"
		:current-page="currentPage"
		:page-sizes="[1, 5, 10, 20]"
		:page-size="5"
		layout="total, sizes, prev, pager, next, jumper"
		:total="total"
	>
	</el-pagination>
</template>

<script>
export default {
	name: 'CategoriesPagination',
	data() {
		return {
			currentPage: 1,
			queryInfo: {
				type: 3,
				pagenum: 1,
				pagesize: 5,
			},
       
		}
	},
	methods: {
		handleSizeChange(val) {
			this.queryInfo.pagesize = val
            this.$store.dispatch('Categories/getData',this.queryInfo)
		},
		handleCurrentChange(val) {
			this.queryInfo.pagenum = val
             this.$store.dispatch('Categories/getData',this.queryInfo)
		},
	},
	computed:{
		total:{
			get(){
					return this.$store.state.Categories.total 
			}
		}
	},
    mounted(){
  
		

    }
}
</script>
